/*
 * Copyright @ 2022 bingye
 * com.example.demo.controller 17:29
 * All right reserved.
 */

package com.example.demo.controller;

import com.example.demo.entity.TUser;
import com.example.demo.service.IUserService;
import com.example.demo.utils.CommonResult;
import com.example.demo.utils.ResResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.omg.PortableInterceptor.USER_EXCEPTION;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @desc:
 * @author: weili23
 * @createTime: 2022/3/30 17:29
 * @version: v1.0
 */
@Api(tags = "用户清单")
@RestController
@RequestMapping(value = "/user")
public class UserController {
    @Autowired
    private IUserService userService;

    @ApiOperation("用户列表")
    @RequestMapping(value = "/all")
    CommonResult queryAllUser(){
        List<TUser> user = userService.queryAllUser();
        return CommonResult.success(user);
    }
    @ApiOperation("测试")
    @PostMapping(value="/test")
    public String test(){
        return "hello";
    }

    @ApiOperation("测试aa")
    @PostMapping(value="/aa")
    public List<TUser> query(){
        return userService.queryAllUser();
    }
}
